# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=username-anarchy
pkgver=72.e063191
pkgrel=3
groups=('blackarch' 'blackarch-automation')
pkgdesc='Tools for generating usernames when penetration testing.'
url='http://www.morningstarsecurity.com/research/username-anarchy'
arch=('any')
license=('GPL3')
depends=('ruby')
makedepends=('git')
source=("git+https://github.com/urbanadventurer/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ruby $pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

